The performance of an electrical machine depends on accurate timing of phase excitation with rotor position. The electrical machine may include a sensor that outputs a signal indicative of the rotor position. Phase excitation then occurs at times relative to edges of the signal. Tolerances within the electrical machine may mean that the duty cycle of the signal is not perfectly balanced. As a result, the performance of the electrical machine may be adversely affected.